package networkcommunicationTCP_IP;

import java.io.*;
import java.net.*;
import java.util.Scanner;

public class ClientTcp {

	public static void main(String[] args) throws IOException{
			System.out.println("尝试连接....");
			System.out.println(InetAddress.getLocalHost().getHostAddress());
			Socket socket=new Socket("10.20.1.75",12304);
			BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
			String zifu=reader.readLine();
			BufferedWriter out=new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
			out.newLine();
			out.write(zifu);
			out.flush();
			System.out.println("连接成功");
				socket.close();
				out.close();
				reader.close();
	
	}
}






